<?php
	if (!defined('EXPONENT')) exit('');
	if (exponent_permissions_check(array('administrate','configure',"create"),$loc)){
		$company=null; $id=0;
		$cat= null; $cat_id = 0;
		
		if (isset($_REQUEST['id']))
		{
			$id=intval($_REQUEST['id']);
		}
			
		
		if (isset($_REQUEST['cat_id']))
		{
			$cat_id=intval($_REQUEST['cat_id']);
		}
			
		if ($cat_id>0 && $id>0)
		{
			// select if already exist record in surveymodule_companies_services or not
			if (isset($_REQUEST['type']))  // for company page\
				$db->sql("DELETE FROM {$db->prefix}surveymodule_companies_services WHERE  (company_id = {$cat_id}) AND (cat_id = {$id})");
			else
				$data = $db->sql("DELETE FROM {$db->prefix}surveymodule_companies_services WHERE  (cat_id = {$cat_id}) AND (company_id = {$id})");
		}
	}
	die();
?>